package main

import (
    "context"
    "github.com/grpc-ecosystem/grpc-gateway/runtime"
    "google.golang.org/grpc"
    "gowork/gatewayMemberGrpc/fjmMessage"
    "log"
    "net/http"
)

func main() {

    gwmux := runtime.NewServeMux()
    opt := []grpc.DialOption{grpc.WithInsecure()}
    err := fjmMessage.RegisterMemberServiceHandlerFromEndpoint(context.Background(), gwmux, "localhost:7429", opt) //localhost这是grpc的地址
    if err != nil {
        log.Fatal(err)
    }

    httpServer := &http.Server{
        Addr:    ":9302",
        Handler: gwmux,
    }
    httpServer.ListenAndServe()
    
}